package com.ctshk.rpc.season.mapper;

import com.ctshk.rpc.season.base.CustomBaseMapper;
import com.ctshk.rpc.season.dto.SeasonProOnlineThirdCustomDTO;
import com.ctshk.rpc.season.entity.SeasonProductChannelOnlineThirdPlatform;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * 套票线上渠道第三方平台 Mapper 接口
 * </p>
 *
 * @author 杨林
 * @since 2021-03-15
 */
public interface SeasonProductChannelOnlineThirdPlatformMapper extends CustomBaseMapper<SeasonProductChannelOnlineThirdPlatform> {
    //根据产品id 获取 套票线上渠道第三方平台 信息
    @Select("<script>" +
            "SELECT  t.id,t.product_id,t.strategy_id,t.platform_id,t.platform_name,t.adjust_type,t.amount,t.percent,t.is_limit,t.limit_num,t.gmt_create,t.gmt_modified,t.create_id,t.modified_id,t.is_deleted FROM t_season_product_channel_online_self_platform t  " +
            " where t.is_deleted = 0" +
            "<if test=\"productId != null and productId != ''\"> AND t.productId = #{productId}</if> \n" +
            "</script>")
    SeasonProOnlineThirdCustomDTO queryThird(@Param("productId") Long productId);
}
